#include <iostream>
#include <stack>
#include <string>
using namespace std;


struct num{
	int number;
	char c;
};


int main(){
	stack<num> sta;
	string s;
	cin>>s;
	num ans;
	ans.number = s[0]-'0';
	ans.c = '+';
	for(int i=1;i<s.length();){
		if(s[i+1] == '('){
			sta.push(ans);
			ans.number = s[i+2]-'0';
			ans.c = s[i];
			i += 3;
		}
		else if(s[i] == '+'){
			ans.number += s[i+1]-'0';
			i += 2;
		}
		else if(s[i] == '*'){
			ans.number *= s[i+1]-'0';
			i += 2;
		}
		else{
			num a=sta.top();
			sta.pop();
			if(ans.c == '+'){
				ans.number += a.number;
				ans.c = a.c;
				i++;
			}
			else{
				ans.number *= a.number;
				ans.c = a.c;
				i++;
			}
		}
	}
	cout<<ans.number;
	return 0;
}


//1+2*(3+4)*5+6
